package com.lxw.report.meta.contract;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModelProperty;


public class BaseFindRequest extends BaseRequest {
    @ApiModelProperty(value = "页码")
    private int pageNumber = 1;
    @ApiModelProperty(value = "每页条数")
    private int pageSize = 10;
    public BaseFindRequest() {
    }

    public int getPageSize() {
        return this.pageSize <= 0 ? -1 : this.pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getPageNumber() {
        return this.pageNumber <= 0 ? 1 : this.pageNumber;
    }

    public void setPageNumber(int pageNumber) {
        this.pageNumber = pageNumber;
    }

    public int getBeginItemIndex() {
        return (this.getPageNumber() - 1) * this.getPageSize();
    }

    public int getEndItemIndex() {
        return this.getPageNumber() * this.getPageSize();
    }
}
